﻿using System;
using System.Collections.Generic;
using System.Linq;

public static class MathScripts
{


    public static bool HaveIsBall(Ball a, Ball b)
    {
        return a.X == b.X && a.Y == b.Y && a.Z == b.Z;
        // return 
    }

    public static List<Ball> ConvertBall(SelectData data)
    {
        List<Ball> ballList = new List<Ball>();

        for (int i = 0; i < data.numbers[0].Count; i++)
        {
            int x = data.numbers[0][i];
            for (int j = 0; j < data.numbers[1].Count; j++)
            {
                int y = data.numbers[1][j];
                for (int k = 0; k < data.numbers[2].Count; k++)
                {
                    int z = data.numbers[2][k];
                    Ball b = new Ball(x, y, z);
                    // ballList.BinarySearch((bbb) => {return   })
                    ballList.Add(b);
                }
            }
        }
        return ballList;
    }
}

public class Ball
{
    public int X { get; set; }
    public int Y { get; set; }
    public int Z { get; set; }

    public Ball(int x, int y, int z)
    {
        int[] array= new int[3]{x,y,z};
        Array.Sort(array);
        X = array[0];
        Y = array[1];
        Z = array[2];
    }
    public void Sort()
    {
        int temp;
        temp = X;
        if (temp > Y)
        {
            
        }
    }
    public override string ToString()
    {
        return $"{X}{Y}{Z}";
    }
}